//
//  ViewController.m
//  userdefaults
//
//  Created by iD Student on 7/17/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController


- (void)viewDidLoad
{
    

	// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    } else {
        return YES;
    }
}

- (IBAction)save:(id)sender{
int score = 2;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
                           [defaults setInteger:score forKey:@"score"];
                            }
                                

- (IBAction)load:(id)sender{
    int score = [[NSUserDefaults standardUserDefaults] integerForKey:@"score"];
    NSString *key = [NSString stringWithFormat:@"%d",score];
}

                            
@end